package com.macro.mall.controller;

import com.macro.mall.common.api.CommonResult;
import com.macro.mall.model.PmsProduct;
import com.macro.mall.model.SmsCoupon;
import com.macro.mall.model.SmsCouponProductRelation;
import com.macro.mall.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/member")
public class MemberController {
    @Autowired
    private MemberService service;
    /**
     * 优惠券列表
     */
    @GetMapping("/coupon/listByProduct/{id}")
    public CommonResult<List<SmsCoupon>> listByProduct(@PathVariable Long id) {
        List<SmsCoupon> list = service.listByProduct(id);
        return CommonResult.success(list);
    }

}
